<%-- 
    Document   : customerList
    Created on : Dec 5, 2013, 2:06:42 PM
    Author     : Istvan_Monori
--%>

<%@page import="com.epam.javatanf2013.services.bo.CustomerBo"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="windows-1252"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>Customer List</title>
    </head>
    <body>
        <% //List<CustomerBo> list = (List<CustomerBo>)request.getAttribute("customerJSP.list"); %>
        <jsp:useBean id="customerJSPList" scope="request" type="java.util.List"/> 
        <h1>Customer List JSP</h1>
        <table>
            <tr>
                <th>Id</th>
                <th>Customer name</th>
                <th>Actions</th>
            </tr>
            <% for (Object customerObj: customerJSPList) { %>
            <% CustomerBo customerBean = (CustomerBo) customerObj; %>
            <tr>
                <td><% out.println(customerBean.getId());%></td>
                <td><% out.println(customerBean.getFullName());%></td>
                <td><a href="<%= request.getContextPath() %>/CustomerJSP/Edit?id=<%=customerBean.getId() %>">Modify</a></td>
            </tr>
            <% } %>
        </table>
        <a href="<%= request.getContextPath() %>/CustomerJSP/Edit">New</a>
    </body>
</html>
